﻿using UnityEngine;
using System.Collections;

public class MilitaryUnit : MonoBehaviour {
	public CardInfo attribute;

	private SimpleMove _moveCtr;
	private Animator _animator;

	void Awake () {
		Debug.Log ("MilitaryUnit Awake");
		_moveCtr = gameObject.AddComponent<SimpleMove> ();
		_moveCtr.onReachDestination = onReach;

		_animator = GetComponent<Animator>();
		_animator.Play("float", 0, Random.Range(0f, 0.9f));
	}

	public void move(Vector3 startPos, Vector3 endpos)
	{
		_moveCtr.move (startPos, endpos);
	}

	private void onReach()
	{
		Debug.Log (gameObject.name + " reach");
	}
}
